
package vn.aptech.project.control;
import vn.aptech.project.model.dao.*;
import java.io.IOException;
import java.sql.SQLException;
import vn.aptech.project.model.dto.*;
import java.util.Vector;

public class  product_BLL {

private product_DAO   obj ;


public product_BLL() throws ClassNotFoundException, SQLException, IOException {
     this.obj   = new  product_DAO();
}


public Vector selectproduct() throws SQLException {
 return  obj.selectall();
}
public Vector selectproduct1() throws SQLException {
 return  obj.selectall1();
}
public Vector totalproduct() throws SQLException
{
return obj.totalproduct();
}
public Vector top5product() throws SQLException
{
return obj.top5product();
}
public int getProductidByProductName(String productname) throws SQLException, IOException {
 return  obj.getProductidByProductName(productname);
}
public Vector SearchByIdAndByName(int productid,String productname) throws SQLException
{
return obj.SearchByIdAndByName(productid, productname);
}
public Vector SearchByIdAndByName1(int productid,String productname) throws SQLException
{
return obj.SearchByIdAndByName1(productid, productname);
}
public Vector SearchProductByName(String productname) throws SQLException
{
return  obj.SearchByName(productname);
}
public Vector SearchProductByName1(String productname) throws SQLException
{
return  obj.SearchByName1(productname);
}
public Vector selectProductByTypeid(int typeid) throws SQLException
{
return obj.selectProductByTypeid(typeid);
}
public Vector selectProductByCategory(String Typeinfo) throws SQLException
{
return  obj.selectByCategory(Typeinfo);
}
public Vector SearchProductById(int productid) throws SQLException
{
return  obj.SearchById(productid);
}
public Vector SearchProductById1(int productid) throws SQLException
{
return  obj.SearchById1(productid);
}

public int insertproduct(product_DTO object) throws SQLException {
 return  obj.insert(object);
}
public int updateQuantity(int quantity,int productid) throws SQLException{
    return obj.updatequantity(quantity,productid);
}

public int updateproduct(product_DTO object) throws SQLException {
 return  obj.update(object);
}


public int deleteproduct(int productid) throws SQLException {
 return  obj.delete(productid);
}
}
